package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 食材采购计划详情表
 * @TableName ingredient_purchase_plan_detail
 */
@TableName(value ="ingredient_purchase_plan_detail")
@Data
public class IngredientPurchasePlanDetail {
    /**
     * 
     */
    @TableId(value = "detail_id", type = IdType.AUTO)
    private Integer detailId;

    /**
     * 采购计划ID
     */
    @TableField(value = "plan_id")
    private Integer planId;

    /**
     * 食材ID
     */
    @TableField(value = "ingredient_id")
    private Integer ingredientId;

    /**
     * 所需数量
     */
    @TableField(value = "required_quantity")
    private BigDecimal requiredQuantity;

    /**
     * 实际采购数量
     */
    @TableField(value = "actual_quantity")
    private BigDecimal actualQuantity;

    /**
     * 单价
     */
    @TableField(value = "unit_price")
    private BigDecimal unitPrice;

    /**
     * 总价
     */
    @TableField(value = "total_price")
    private BigDecimal totalPrice;

    /**
     * 供应商
     */
    @TableField(value = "supplier")
    private String supplier;

    /**
     * 采购日期
     */
    @TableField(value = "purchase_date")
    private Date purchaseDate;

    /**
     * 采购状态
     */
    @TableField(value = "purchase_status")
    private Object purchaseStatus;

    /**
     * 采购人ID
     */
    @TableField(value = "purchaser_id")
    private Integer purchaserId;

    /**
     * 采购备注
     */
    @TableField(value = "purchase_remarks")
    private String purchaseRemarks;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        IngredientPurchasePlanDetail other = (IngredientPurchasePlanDetail) that;
        return (this.getDetailId() == null ? other.getDetailId() == null : this.getDetailId().equals(other.getDetailId()))
            && (this.getPlanId() == null ? other.getPlanId() == null : this.getPlanId().equals(other.getPlanId()))
            && (this.getIngredientId() == null ? other.getIngredientId() == null : this.getIngredientId().equals(other.getIngredientId()))
            && (this.getRequiredQuantity() == null ? other.getRequiredQuantity() == null : this.getRequiredQuantity().equals(other.getRequiredQuantity()))
            && (this.getActualQuantity() == null ? other.getActualQuantity() == null : this.getActualQuantity().equals(other.getActualQuantity()))
            && (this.getUnitPrice() == null ? other.getUnitPrice() == null : this.getUnitPrice().equals(other.getUnitPrice()))
            && (this.getTotalPrice() == null ? other.getTotalPrice() == null : this.getTotalPrice().equals(other.getTotalPrice()))
            && (this.getSupplier() == null ? other.getSupplier() == null : this.getSupplier().equals(other.getSupplier()))
            && (this.getPurchaseDate() == null ? other.getPurchaseDate() == null : this.getPurchaseDate().equals(other.getPurchaseDate()))
            && (this.getPurchaseStatus() == null ? other.getPurchaseStatus() == null : this.getPurchaseStatus().equals(other.getPurchaseStatus()))
            && (this.getPurchaserId() == null ? other.getPurchaserId() == null : this.getPurchaserId().equals(other.getPurchaserId()))
            && (this.getPurchaseRemarks() == null ? other.getPurchaseRemarks() == null : this.getPurchaseRemarks().equals(other.getPurchaseRemarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDetailId() == null) ? 0 : getDetailId().hashCode());
        result = prime * result + ((getPlanId() == null) ? 0 : getPlanId().hashCode());
        result = prime * result + ((getIngredientId() == null) ? 0 : getIngredientId().hashCode());
        result = prime * result + ((getRequiredQuantity() == null) ? 0 : getRequiredQuantity().hashCode());
        result = prime * result + ((getActualQuantity() == null) ? 0 : getActualQuantity().hashCode());
        result = prime * result + ((getUnitPrice() == null) ? 0 : getUnitPrice().hashCode());
        result = prime * result + ((getTotalPrice() == null) ? 0 : getTotalPrice().hashCode());
        result = prime * result + ((getSupplier() == null) ? 0 : getSupplier().hashCode());
        result = prime * result + ((getPurchaseDate() == null) ? 0 : getPurchaseDate().hashCode());
        result = prime * result + ((getPurchaseStatus() == null) ? 0 : getPurchaseStatus().hashCode());
        result = prime * result + ((getPurchaserId() == null) ? 0 : getPurchaserId().hashCode());
        result = prime * result + ((getPurchaseRemarks() == null) ? 0 : getPurchaseRemarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", detailId=").append(detailId);
        sb.append(", planId=").append(planId);
        sb.append(", ingredientId=").append(ingredientId);
        sb.append(", requiredQuantity=").append(requiredQuantity);
        sb.append(", actualQuantity=").append(actualQuantity);
        sb.append(", unitPrice=").append(unitPrice);
        sb.append(", totalPrice=").append(totalPrice);
        sb.append(", supplier=").append(supplier);
        sb.append(", purchaseDate=").append(purchaseDate);
        sb.append(", purchaseStatus=").append(purchaseStatus);
        sb.append(", purchaserId=").append(purchaserId);
        sb.append(", purchaseRemarks=").append(purchaseRemarks);
        sb.append("]");
        return sb.toString();
    }
}